package com.dyh.quickdemozwei;

import com.alibaba.fastjson.JSONObject;
import com.dyh.quickdemozwei.dao.mapper.IntegrateMapper;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

@Configuration
public class FcBeanConfig {


    public void func(){
        System.out.println("xawdd");
    }

    interface MyItf{
        Object apply(Object x);
    }

    @Bean
    MyItf myItf1(){
        return x->{
            System.out.println("myItf1");
            return x;
        };
    }


    @Bean
    MyItf myItf2(){
        return x->{
            System.out.println("myItf2");
            return x;
        };
    }



//    @Bean
//    Function<String, List<JSONObject>> xxx(
//             MyItf myItf1
//            ,MyItf myItf2){
//        return e->{
//            myItf1.apply("xx");
//            myItf2.apply("yy");
//           return new ArrayList<>();
//        };
//    }


    @Bean
    Function<String, List<JSONObject>> xxx(
            MyItf myItf1
            ,MyItf myItf2){
        return e->{
            myItf1.apply("xx");
            myItf2.apply("yy");
            return new ArrayList<>();
        };
    }




    @Bean
    Function<String, List<JSONObject>> FC_IGT_SQL(IntegrateMapper integrateMapper){
        return e->{
            System.out.println(e);
            return integrateMapper.commonSelect(e);
        };
    }




}
